package com.lagou.sqlsession;



import com.lagou.pojo.Configuration;
import com.lagou.sqlsession.impl.DefaultSqlSessionFactory;
import com.lagou.xmls.XMLConfigBuilder;

import java.io.InputStream;

/**
 * @Description:
 * @author liujunling
 * @date 2020/3/31
 */
public class SqlSessionFactoryBuilder {
    public SqlSessionFactory build(InputStream in) throws Exception {
        XMLConfigBuilder xmlConfigBuilder = new XMLConfigBuilder();
        Configuration configuration = xmlConfigBuilder.parse(in);
        return new DefaultSqlSessionFactory(configuration);
    }
}
